import { _decorator, Component, Node, CCFloat } from 'cc';
const { ccclass, property } = _decorator;

@ccclass('Sway')
export default class Sway extends Component {
    @property(Node)
    target: Node | null = null;
    @property(CCFloat)
    duration: number = 1;
    @property(CCFloat)
    angle1: number = -15;
    @property(CCFloat)
    angle2: number = 15;
    tween = null;
    onLoad() {
        // if (!this.target) {
        // this.target = this.node;
        // }

        // this.StartTween();
    }
    async StartTween() {
        // this.tween = cc.tween(this.target)
        // .repeatForever(
        // cc.tween()
        // .call(() => {
        // })
        // .to(this.duration, { angle: this.angle1 }, { easing: "" })
        // .to(this.duration, { angle: this.angle2 }, { easing: "" })
        // )
        // this.tween.start();
    }
    async StopTween() {
        // this.tween?.stop();
    }
}